﻿<UserControl xmlns:my="clr-namespace:ExORMDesginer.UserControls.CCodeEditer"  xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="ExORMDesginer.UserControls.Dialogs.EntityInfomationDialogView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        
        Loaded="UserControl_Loaded">
    <Grid Name="grid" Background="#FF2F2F3A"  >
        <Grid.RowDefinitions>
            <RowDefinition Height="65" />
            <RowDefinition Height="550" />
            <RowDefinition Height="0*" />
            <RowDefinition Height="31" />
        </Grid.RowDefinitions>
        <Label Content="{Binding Model.EntityInfo.DisplayName,Mode=TwoWay,IsAsync=True}" Height="43" Foreground="#FFE6D6F2" HorizontalAlignment="Left" Margin="15,12,0,10"  x:Name="label1" VerticalAlignment="Center" Width="613" FontSize="28" />
        <TextBox x:Name="tb1" Visibility="Collapsed" Text="{Binding Model.EntityInfo.DisplayName,Mode=TwoWay}" Width="613" Height="43" FontSize="28" HorizontalAlignment="Left" Margin="15,12,0,10"  VerticalAlignment="Center"/>
        <GridSplitter Height="1.5" Grid.Row="1"/>
        <telerik:RadGridView Foreground="WhiteSmoke"  AutoGenerateColumns="False" Grid.Row="1"  Margin="10,10,10,0" Name="dataGrid1" DataContext="{Binding Model.EntityInfo}" ItemsSource="{Binding Propertys,Mode=TwoWay,IsAsync=True}" FontSize="14" FontFamily="Microsoft YaHei"  CanUserReorderColumns="False" HorizontalGridLinesBrush="#FFE8E5E5"  VerticalGridLinesBrush="#FFEFE5E5"  CanUserDeleteRows="False" CanUserResizeRows="False" CanUserSortColumns="False" DataLoadMode="Asynchronous" IsFilteringAllowed="False" ShowGroupPanel="False">
            <telerik:RadGridView.Columns>

                <telerik:GridViewDataColumn   Header="列名" DataMemberBinding="{Binding Name}" EditTriggers="None" />
                <telerik:GridViewCheckBoxColumn  Header="主键"  DataMemberBinding="{Binding IsPrimaryKey,Mode=TwoWay}" EditTriggers="None" />
                <telerik:GridViewCheckBoxColumn Header="自增列" DataMemberBinding="{Binding IsIdentity,Mode=TwoWay}" EditTriggers="None" />
                <telerik:GridViewCheckBoxColumn Header="可空" DataMemberBinding="{Binding IsNull,Mode=TwoWay}" EditTriggers="None" />
                <telerik:GridViewDataColumn Header="类型" DataMemberBinding="{Binding DataType,Mode=TwoWay}" EditTriggers="None"/>
                <telerik:GridViewDataColumn Header="长度" DataMemberBinding="{Binding DataLength,Mode=TwoWay}" EditTriggers="None"/>
                <telerik:GridViewDataColumn Header="默认值" DataMemberBinding="{Binding DefaultValue,Mode=TwoWay}"/>
                <telerik:GridViewCheckBoxColumn Header="可移除" DataMemberBinding="{Binding IsRemoveable,Mode=TwoWay}" EditTriggers="CellClick"/>
                <telerik:GridViewDataColumn Header="说明" DataMemberBinding="{Binding DisplayName,Mode=TwoWay}" MinWidth="350" Width="550" EditTriggers="CellClick" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
        <StackPanel Grid.Row="2">
            <my:CCodeEditer x:Name="editer" EditerType="SQL" DataContext="{Binding Model.EntityInfo}"  Text="{Binding SQL,Mode=TwoWay}" InitText="{Binding SQL,Mode=OneTime}" Margin="10" Height="0" />
        </StackPanel>
        <StackPanel Grid.Row="3" Orientation="Horizontal"  HorizontalAlignment="Right" >

            <Button  Content="保存" Grid.Row="2" Height="23" Margin="0,0,10,0" HorizontalAlignment="Right"  x:Name="OK" VerticalAlignment="Center" Width="75"  />
            <Button  Content="取消" Grid.Row="2" Height="23" Margin="0,0,10,0" HorizontalAlignment="Right"  x:Name="Cancel" VerticalAlignment="Center" Width="75"  />

        </StackPanel>
    
    </Grid>
</UserControl>
